package com.xbongbong.pro.dataset.service.impl;

import com.xbongbong.config.DataSource;
import com.xbongbong.config.DataSourceNames;
import com.xbongbong.paas.domain.entity.ext.CkPaasFormDataEntityExt;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.dataset.service.CkDataService;
import com.xbongbong.saas.domain.dao.WorkOrderFlowUserDao;
import com.xbongbong.saas.domain.entity.WorkOrderFlowUserEntity;
import com.xbongbong.saas.model.CkPaasFormDataModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 描述信息
 *
 * @ClassName CkPaasFormDataServiceImpl
 * @Author 梁鲁江
 * 创建时间 2021/10/15 16:08
 * 修改时间  2021/10/15 16:08
 **/
@Service("ckDataService")
public class CkDataServiceImpl implements CkDataService {
    @Resource
    private CkPaasFormDataModel ckPaasFormDataModel;
    @Resource
    private WorkOrderFlowUserDao workOrderFlowUserDao;
    
    @DataSource(DataSourceNames.CK_DATA)
    @Override
    public List<CkPaasFormDataEntityExt> findEntitys(Map<String, Object> entity) {
        //TODO SQL的预校验
        return ckPaasFormDataModel.findEntitys(entity);
    }
    @DataSource(DataSourceNames.CK_DATA)
    @Override
    public List<CkPaasFormDataEntityExt> findEntitysBySql(String sql) {
        return ckPaasFormDataModel.findEntitysBySql(sql);
    }
    @DataSource(DataSourceNames.CK_DATA)
    @Override
    public List findListMapBySql(String sql) {
        return ckPaasFormDataModel.findListMapBySql(sql);
    }
    @DataSource(DataSourceNames.CK_DATA)
    @Override
    public Integer countBySql(String sql) {
        return ckPaasFormDataModel.countBySql(sql);
    }

    @DataSource(DataSourceNames.CK_DATA)
    @Override
    public void insertBatch(List<WorkOrderFlowUserEntity> workOrderFlowUserEntityList) throws XbbException {
        workOrderFlowUserDao.insertBatchCK(workOrderFlowUserEntityList);
    }

}
